<script lang="ts" setup>
import { computed, ref } from 'vue'
const props = defineProps<{
  disable?:boolean
}>()
const  showPopover = ref(false)
const actions = computed(()=>[{text:'查看处方',disabled:props.disable},
{text:'删除订单'}])

const emit = defineEmits<{
  (e:'on-preview'):void,
  (e:'on-delete'):void
}>()
const onSelect = (actions:{text:string},i:number)=>{
  // console.log('选择了')
  // console.log(i)
  if(i === 0){
    // 查看处方
    // onShowPrescription(props.item.prescriptionId)
    emit('on-preview')
  }
  if(i===1){
    // 删除订单
    // deleteConsultOreder(props.item)
    emit('on-delete')
  }
}
</script>

<template>
  <div class="consult-more">
        <van-popover v-model:show="showPopover" :actions="actions" @select="onSelect" placement="top-start">
          <template #reference>更多</template>
        </van-popover>
      </div>
</template>

<style lang="scss">
.consult-more{
        color: var(--cp-tag);
      flex: 1;
      font-size: 13px;
}
</style>
